class MyThread7 extends Thread{
    @Override
    public void run() {
        while(true){
            System.out.println("thread\n");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
public class ThreadDemo7 {
    public static void main(String[] args) {
        Thread t = new MyThread7();

        //1.
        t.start();

        //2.
        // t.run();

        while(true){
            System.out.println("main\n");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }

    }
}
